<div id="enable_countries_form">
	<h2>Enable or Disable Countries</h2>
	<div class="content">
		<div class="form400">
			<?= Phpr_Form::openTag() ?>
				<? if (!isset($fatalError)): ?>
					<p>Countries selected: <?= $country_count ?></p>
					
					<div class="form">
						<div class="form_page">
							<ul class="formElements">
								<li class="field checkbox full">
									<label for="Shop_Country_enabled">
										Enabled
										<span class="comment">Disabled countries are not shown on the front-end store.  </span>
									</label>

									<div class="fieldContainer">
										<input type="hidden" class="checkbox" value="" name="enabled">
										<input type="checkbox" class="checkbox" value="1" name="enabled" id="Shop_Country_enabled">
									</div>

									<div class="clear"></div>
								</li>

								<li class="field checkbox full">
									<label for="Shop_Country_enabled_in_backend">
										Enabled in the Administration Area
										<span class="comment">Use this checkbox if you want the country to be enabled in the Administration Area.  </span>
									</label>

									<div class="fieldContainer">
										<input type="hidden" class="checkbox" value="" name="enabled_in_backend">
										<input type="checkbox" class="checkbox" value="1" name="enabled_in_backend" id="Shop_Country_enabled_in_backend">
									</div>

									<div class="clear"></div>
								</li>
							</ul>
							<div class="clear"></div>
						</div>
					</div>
					
					<script type="text/javascript">
						$('enable_countries_form').addEvent('popupLoaded', function(){
							var enabled_cb = $('Shop_Country_enabled');
							var enabled_aa_cb = $('Shop_Country_enabled_in_backend');
							if (enabled_cb && enabled_aa_cb)
							{
								enabled_cb.addEvent('click', function(){

									if (enabled_cb.checked)
									{
										enabled_aa_cb.cb_check();
										enabled_aa_cb.cb_disable();
									} else
										enabled_aa_cb.cb_enable();
								});
							}
						});
					</script>

					<?= backend_ajax_button('Apply', 'countries_onApplyCountriesEnabledStatus', array(), "
						confirm: 'Are you sure?', 
						loadIndicator: {injectInElement: true},
						onSuccess: cancelPopup,
						extraFields: $('listShop_Settings_countries_list_body').getForm(),
						update: 'listShop_Settings_countries_list'") ?>

					<?= backend_button('Cancel', array('onclick'=>'return cancelPopup()')) ?>
					<div class="clear"></div>
				<? else: ?>
					<?= flash() ?>
					<?= backend_button('Cancel', array('onclick'=>'return cancelPopup()')) ?>
					<div class="clear"></div>
				<? endif ?>
			</form>
		</div>
	</div>
</div>